
<template>
  <view class="with-list" v-if="dataArr && dataArr.length">
    <scroll-view
      class="scroll-box"
      :scroll-y="true"
      @scrolltolower="reachBottom"
      lower-threshold="150"
    >
      <view class="text-area">
        <view class="item" v-for="(item, index) in dataArr" :key="index">
          <view class="u-slot-title1 line">
            <view class="left">提现类型</view>
            <view class="right">{{ item.cashTypeDesc || "--" }} </view>
          </view>
          <view  class="u-slot-title1 line">
            <view class="left">提现方式 </view>
            <view class="right">{{ item.applyPayWayDesc || "--" }} </view>
          </view>

          <view  class="u-slot-title1 line">
            <view class="left">提现金额 </view>
            <view class="right">￥{{ item.cashFee }} </view>
          </view>
          <view  class="u-slot-title1">
            <view class="left">提现时间 </view>
            <view class="right">{{ item.addTime || "--" }} </view>
          </view>
        </view>
      </view>

      <view>
        <u-loadmore
          :status="status"
          :loading-text="loadingText"
          :loadmore-text="loadmoreText"
          :nomore-text="nomoreText"
        />
      </view>
    </scroll-view>
  </view>
  <view
    class="with-list"
    v-else-if="dataArr && dataArr.length === 0 && showFlag"
  >
    <view class="no-data">暂无数据</view>
  </view>
</template>

<script>
import { getStoreData, setStoreData, httpPost, httpGet } from "@/utils/http.js";
const date = new Date();
const year = date.getFullYear();
const month =
  date.getMonth() + 1 > 9 ? date.getMonth() + 1 : "0" + (date.getMonth() + 1);
const date1 = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
export default {
  data() {
    return {
      showFlag: false,
      dataArr: [],
      status: "loadmore",
      loadingText: "努力加载中",
      loadmoreText: "",
      nomoreText: "",
      listInfo: {
        pageNo: 1,
        pageSize: 10,
        pages: 0,
        total: 0,
      },
    };
  },
  onShow() {
    this.showFlag = false;
    this.getdataFun();
  },
  methods: {
    reachBottom() {
      this.status = "nomore";
      return;
    },
    getdataFun() {
      const _this = this;
      if (this.listInfo.pageNo === 1) {
        this.dataArr = [];
      }
      this.nomoreText = "";
      httpPost("/api/orderformcash/list", {
        pageNo: this.listInfo.pageNo,
        pageSize: 1000,
        types: [10, 20, 30, 40],
      })
        .then((res) => {
          const result = res.data;
          _this.dataArr.push(...result.list);
          _this.status = "nomore";
          _this.nomoreText = "没有更多了";
          _this.showFlag = true;
        })
        .catch((e) => {
          _this.showFlag = true;
        });
    },
  },
};
</script>

<style lang="scss">
.with-list {
  display: flex;
  background: #f8f8f8;
  width: 100vw;
  min-height: 100vh;
  font-size: 14px;
  .no-data {
    width: 100%;
    color: #666;
    text-align: center;
    margin: 48px;
  }
  .item {
    background: #fff;
    border-radius: 4px;
    margin-bottom: 16px;
    padding: 12px 8px;
    .line {
      border-bottom: 1px solid #eee;
    }
  }
  .text-area {
    width: calc(100vw - 32px);
    color: #333;
    font-size: 14px;
    margin: 16px;
    .tips2 {
      color: #f00;
      text-align: right;
    }
    .title {
      line-height: 30px;
      color: #666;
      margin-left: 16px;
    }
  }
  .u-slot-title1 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    line-height: 40px;
  }
  .u-slot-title2 {
    display: flex;
    flex-direction: column;
  }
  .total {
    width: 120px;
    height: 120px;
    display: flex;
    margin-top: 32px;
    font-size: 14px;
    color: #fff;
    justify-content: center;
    align-content: center;
    background: linear-gradient(-90deg, #f90, #f60);
    box-shadow: 6px 12px 32px 12px rgba(247, 213, 62, 0.897);
    border-radius: 50%;
    .num {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      .value {
        font-size: 16px;
        line-height: 30px;
      }
    }
  }
}
</style>
